package com.hiultra.archive.controller;

import com.hiultra.archive.domain.SimfExamineItem;
import com.hiultra.archive.service.IElecPatchService;
import com.hiultra.common.core.controller.BaseController;
import com.hiultra.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"审批补丁"})
@RestController
@RequestMapping({"elecPatch/"})
public class ElecPatchController extends BaseController {

    @Autowired
    private IElecPatchService examinePatchService;


    /**
     * 提交审批
     */
    @ApiOperation(value = "提交审批", notes = "提交审批 ")
    @PostMapping("batchToExamine")
    public AjaxResult batchToExamine(String pks, String examineType) {
        return toAjax(examinePatchService.batchToExamine(examineType, pks));
    }

    /**
     * 审批记录通过
     **/
    @ApiOperation(value = "编辑保存", notes = "修改")
    @PostMapping("approved")
    public AjaxResult approved(@RequestBody SimfExamineItem entity) {
        return toAjax(examinePatchService.approved(entity));
    }

    /**
     * 审批记录编辑保存
     **/
    @ApiOperation(value = "编辑保存", notes = "修改")
    @PostMapping("failed")
    public AjaxResult failed(@RequestBody SimfExamineItem entity, String examineType) {
        return toAjax(examinePatchService.failed(entity, examineType));
    }
}
